/* 基本重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 2160px;
    height: 3840px;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    /* align-items: center; */
    background-color: #e0e0e0;
    touch-action: none;
    overflow: hidden;
}

body{
    background-color: rgb(80, 80, 80);
    background-image: url("./../pic/bg2.png");
    background-repeat: no-repeat;
    background-size: cover;
}

#app{
    position: absolute;
}

#loading-container {
    width: 2160px;
    height: 3840px;
    position: absolute;
    z-index: 10000;
    background-color: rgb(80, 80, 80);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    /* 初始透明度为1 */
    transition: opacity 1s ease;
    /* 添加透明度过渡效果 */
}

#loading-container svg {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 80%;
    transform: translate(-50%, -50%);
}



/* 摄像机容器 */
#camera-container {
    position: absolute;
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    top: 1100px;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 摄像机 */
#camera {
    width: 100%;
    height: 100%;
}

#canvas{
    position: absolute;
    left: 0;
    top: 0;
    /* transform: scaleX(-1); */
}

/* 临时显示AI图像overlay */
.temporary-image {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    object-fit: cover;
    transition: opacity 1s ease-in-out;
    /* transform: scaleX(-1); */
    /* 透明度过渡效果 */
}

/* 闪光灯效果overlay */
.flash-layer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(255, 255, 255, 0.8);
    /* 白色背景，透明度可以调整 */
    z-index: 20;
    /* 确保它位于视频上层 */
    animation: flash-animation 0.1s ease-in-out;
    /* 闪光动画 */
}

/* 闪光动画：从不透明到透明 */
@keyframes flash-animation {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 0;
    }
}






/* 应用离线消息 */
.offline-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ff4444;
    color: white;
    text-align: center;
    padding: 1em;
    z-index: 1000;
}


/* 安装按钮 */
.install-button {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 50px;
    background: #39393945;
    border: none;
    border-radius: 5%;
    color: white;
}


/* 快门按钮  */
.shutter-button {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    padding: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.shutter-button::before {
    content: '';
    position: absolute;
    width: 100px;
    height: 100px;
    background-image: url('./../icon/color_pet.svg');
    z-index: 2;
    background: #fff;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    border: 1px solid #525252;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
}

.shutter-button:active::before {
    width: 95px;
    height: 95px;
    background: #e0e0e0;
}

#countdown-overlay{
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
}

#countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 150px;
    color: white;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    z-index: 1000;
    pointer-events: none;
}

.countdown-animation {
    animation: countdown 1s ease-out;
}

@keyframes countdown {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
}




/* 日志容器 */
.log-container {
    position: absolute;
    bottom: 10%;
    /* 从底部偏移 10% */
    left: 10px;
    width: 30%;
    /* 宽度占据 80% */
    max-height: 200px;
    /* 最大高度设置 */
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    overflow-y: auto;
    /* 如果内容超出则出现滚动条 */
    z-index: 1000;
}

/* 日志项 */
.log-item {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.5;
}